import React, {Component, useContext} from 'react';

// 组件
let AppContext = React.createContext({});

function Child() {


  return (
    <AppContext.Provider value={
      {
        usernames: ['石原伊美', '玛丽莲梦露', '波多姐姐', '苍老师', '小泽姐姐'],
      }
    }>
      <div>
        <br/>
        <GrandSon1/>
        <GrandSon2/>
      </div>
    </AppContext.Provider>
  );

}

function GrandSon1(props) {
  let {usernames} = useContext(AppContext);
  console.log(usernames, 1111111);
  return (
    <div>

    </div>
  )
}

function GrandSon2(props) {
  let {usernames} = useContext(AppContext);
  console.log(usernames, 222222);

  return (
    <div>

    </div>
  )
}


export default Child;
